CXX = g++
CXXFLAGS = -std=c++17 -Wall -pthread -Icommon -Iserver

SERVER_SRC = \
    server/server_main.cpp \
    server/server_core.cpp \
    common/thread_pool.cpp \
    common/user_manager.cpp \
    common/room_manager.cpp

CLIENT_SRC = \
    client/client.cpp

TARGET_SERVER = server_chat
TARGET_CLIENT = client_chat

all: $(TARGET_SERVER) $(TARGET_CLIENT)

$(TARGET_SERVER): $(SERVER_SRC)
	$(CXX) $(CXXFLAGS) -o $@ $^

$(TARGET_CLIENT): $(CLIENT_SRC)
	$(CXX) $(CXXFLAGS) -o $@ $^

clean:
	rm -f $(TARGET_SERVER) $(TARGET_CLIENT)

